// Copyright (c) Lawrence Livermore National Security, LLC and other VisIt
// Project developers.  See the top-level LICENSE file for dates and other
// details.  No copyright assignment is required to contribute to VisIt.

package llnl.visit.plots;

import llnl.visit.AttributeSubject;
import llnl.visit.CommunicationBuffer;
import llnl.visit.Plugin;
import llnl.visit.ColorControlPointList;
import llnl.visit.GaussianControlPointList;

// ****************************************************************************
// Class: VolumeAttributes
//
// Purpose:
//    This class contains the plot attributes for the volume plot.
//
// Notes:      Autogenerated by xml2java.
//
// Programmer: xml2java
// Creation:   omitted
//
// Modifications:
//
// ****************************************************************************

public class VolumeAttributes extends AttributeSubject implements Plugin
{
    private static int VolumeAttributes_numAdditionalAtts = 45;

    // Enum values
    public final static int RENDERER_SERIAL = 0;
    public final static int RENDERER_PARALLEL = 1;
    public final static int RENDERER_COMPOSITE = 2;
    public final static int RENDERER_INTEGRATION = 3;
    public final static int RENDERER_SLIVR = 4;

    public final static int RESAMPLETYPE_ONLYIFREQUIRED = 0;
    public final static int RESAMPLETYPE_SINGLEDOMAIN = 1;
    public final static int RESAMPLETYPE_PARALLELREDISTRIBUTE = 2;
    public final static int RESAMPLETYPE_PARALLELPERRANK = 3;
    public final static int RESAMPLETYPE_NORESAMPLING = 4;

    public final static int RESAMPLECENTERING_NATIVECENTERING = 0;
    public final static int RESAMPLECENTERING_NODALCENTERING = 1;
    public final static int RESAMPLECENTERING_ZONALCENTERING = 2;

    public final static int GRADIENTTYPE_CENTEREDDIFFERENCES = 0;
    public final static int GRADIENTTYPE_SOBELOPERATOR = 1;

    public final static int SCALING_LINEAR = 0;
    public final static int SCALING_LOG = 1;
    public final static int SCALING_SKEW = 2;

    public final static int LIMITSMODE_ORIGINALDATA = 0;
    public final static int LIMITSMODE_CURRENTPLOT = 1;

    public final static int SAMPLINGTYPE_KERNELBASED = 0;
    public final static int SAMPLINGTYPE_RASTERIZATION = 1;
    public final static int SAMPLINGTYPE_TRILINEAR = 2;

    public final static int OPACITYMODES_FREEFORMMODE = 0;
    public final static int OPACITYMODES_GAUSSIANMODE = 1;
    public final static int OPACITYMODES_COLORTABLEMODE = 2;

    public final static int LOWGRADIENTLIGHTINGREDUCTION_OFF = 0;
    public final static int LOWGRADIENTLIGHTINGREDUCTION_LOWEST = 1;
    public final static int LOWGRADIENTLIGHTINGREDUCTION_LOWER = 2;
    public final static int LOWGRADIENTLIGHTINGREDUCTION_LOW = 3;
    public final static int LOWGRADIENTLIGHTINGREDUCTION_MEDIUM = 4;
    public final static int LOWGRADIENTLIGHTINGREDUCTION_HIGH = 5;
    public final static int LOWGRADIENTLIGHTINGREDUCTION_HIGHER = 6;
    public final static int LOWGRADIENTLIGHTINGREDUCTION_HIGHEST = 7;

    public final static int OSPRAYRENDERTYPES_SCIVIS = 0;
    public final static int OSPRAYRENDERTYPES_PATHTRACER = 1;


    public VolumeAttributes()
    {
        super(VolumeAttributes_numAdditionalAtts);

        OSPRayEnabledFlag = false;
        OSPRayRenderType = OSPRAYRENDERTYPES_SCIVIS;
        OSPRayShadowsEnabledFlag = false;
        OSPRayUseGridAcceleratorFlag = false;
        OSPRayPreIntegrationFlag = false;
        OSPRaySingleShadeFlag = false;
        OSPRayOneSidedLightingFlag = false;
        OSPRayAOTransparencyEnabledFlag = false;
        OSPRaySPP = 1;
        OSPRayAOSamples = 0;
        OSPRayAODistance = 100000;
        OSPRayMinContribution = 0.001;
        OSPRayMaxContribution = 2;
        legendFlag = true;
        lightingFlag = true;
        colorControlPoints = new ColorControlPointList();
        opacityAttenuation = 1f;
        opacityMode = OPACITYMODES_FREEFORMMODE;
        opacityControlPoints = new GaussianControlPointList();
        resampleType = RESAMPLETYPE_ONLYIFREQUIRED;
        resampleTarget = 1000000;
        resampleCentering = RESAMPLECENTERING_NATIVECENTERING;
        opacityVariable = new String("default");
        freeformOpacity = new byte[256];
        for(int i = 0; i < 256; ++i)
            freeformOpacity[i] = (byte)i;
        useColorVarMin = false;
        colorVarMin = 0f;
        useColorVarMax = false;
        colorVarMax = 0f;
        useOpacityVarMin = false;
        opacityVarMin = 0f;
        useOpacityVarMax = false;
        opacityVarMax = 0f;
        smoothData = false;
        samplesPerRay = 500;
        rendererType = RENDERER_SERIAL;
        gradientType = GRADIENTTYPE_SOBELOPERATOR;
        scaling = SCALING_LINEAR;
        skewFactor = 1;
        limitsMode = LIMITSMODE_ORIGINALDATA;
        sampling = SAMPLINGTYPE_RASTERIZATION;
        rendererSamples = 3f;
        lowGradientLightingReduction = LOWGRADIENTLIGHTINGREDUCTION_LOWER;
        lowGradientLightingClampFlag = false;
        lowGradientLightingClampValue = 1;
        materialProperties = new double[4];
        materialProperties[0] = 0.4;
        materialProperties[1] = 0.75;
        materialProperties[2] = 0;
        materialProperties[3] = 15;
    }

    public VolumeAttributes(int nMoreFields)
    {
        super(VolumeAttributes_numAdditionalAtts + nMoreFields);

        OSPRayEnabledFlag = false;
        OSPRayRenderType = OSPRAYRENDERTYPES_SCIVIS;
        OSPRayShadowsEnabledFlag = false;
        OSPRayUseGridAcceleratorFlag = false;
        OSPRayPreIntegrationFlag = false;
        OSPRaySingleShadeFlag = false;
        OSPRayOneSidedLightingFlag = false;
        OSPRayAOTransparencyEnabledFlag = false;
        OSPRaySPP = 1;
        OSPRayAOSamples = 0;
        OSPRayAODistance = 100000;
        OSPRayMinContribution = 0.001;
        OSPRayMaxContribution = 2;
        legendFlag = true;
        lightingFlag = true;
        colorControlPoints = new ColorControlPointList();
        opacityAttenuation = 1f;
        opacityMode = OPACITYMODES_FREEFORMMODE;
        opacityControlPoints = new GaussianControlPointList();
        resampleType = RESAMPLETYPE_ONLYIFREQUIRED;
        resampleTarget = 1000000;
        resampleCentering = RESAMPLECENTERING_NATIVECENTERING;
        opacityVariable = new String("default");
        freeformOpacity = new byte[256];
        for(int i = 0; i < 256; ++i)
            freeformOpacity[i] = (byte)i;
        useColorVarMin = false;
        colorVarMin = 0f;
        useColorVarMax = false;
        colorVarMax = 0f;
        useOpacityVarMin = false;
        opacityVarMin = 0f;
        useOpacityVarMax = false;
        opacityVarMax = 0f;
        smoothData = false;
        samplesPerRay = 500;
        rendererType = RENDERER_SERIAL;
        gradientType = GRADIENTTYPE_SOBELOPERATOR;
        scaling = SCALING_LINEAR;
        skewFactor = 1;
        limitsMode = LIMITSMODE_ORIGINALDATA;
        sampling = SAMPLINGTYPE_RASTERIZATION;
        rendererSamples = 3f;
        lowGradientLightingReduction = LOWGRADIENTLIGHTINGREDUCTION_LOWER;
        lowGradientLightingClampFlag = false;
        lowGradientLightingClampValue = 1;
        materialProperties = new double[4];
        materialProperties[0] = 0.4;
        materialProperties[1] = 0.75;
        materialProperties[2] = 0;
        materialProperties[3] = 15;
    }

    public VolumeAttributes(VolumeAttributes obj)
    {
        super(obj);

        int i;

        OSPRayEnabledFlag = obj.OSPRayEnabledFlag;
        OSPRayRenderType = obj.OSPRayRenderType;
        OSPRayShadowsEnabledFlag = obj.OSPRayShadowsEnabledFlag;
        OSPRayUseGridAcceleratorFlag = obj.OSPRayUseGridAcceleratorFlag;
        OSPRayPreIntegrationFlag = obj.OSPRayPreIntegrationFlag;
        OSPRaySingleShadeFlag = obj.OSPRaySingleShadeFlag;
        OSPRayOneSidedLightingFlag = obj.OSPRayOneSidedLightingFlag;
        OSPRayAOTransparencyEnabledFlag = obj.OSPRayAOTransparencyEnabledFlag;
        OSPRaySPP = obj.OSPRaySPP;
        OSPRayAOSamples = obj.OSPRayAOSamples;
        OSPRayAODistance = obj.OSPRayAODistance;
        OSPRayMinContribution = obj.OSPRayMinContribution;
        OSPRayMaxContribution = obj.OSPRayMaxContribution;
        legendFlag = obj.legendFlag;
        lightingFlag = obj.lightingFlag;
        colorControlPoints = new ColorControlPointList(obj.colorControlPoints);
        opacityAttenuation = obj.opacityAttenuation;
        opacityMode = obj.opacityMode;
        opacityControlPoints = new GaussianControlPointList(obj.opacityControlPoints);
        resampleType = obj.resampleType;
        resampleTarget = obj.resampleTarget;
        resampleCentering = obj.resampleCentering;
        opacityVariable = new String(obj.opacityVariable);
        freeformOpacity = new byte[256];
        for(i = 0; i < obj.freeformOpacity.length; ++i)
            freeformOpacity[i] = obj.freeformOpacity[i];

        useColorVarMin = obj.useColorVarMin;
        colorVarMin = obj.colorVarMin;
        useColorVarMax = obj.useColorVarMax;
        colorVarMax = obj.colorVarMax;
        useOpacityVarMin = obj.useOpacityVarMin;
        opacityVarMin = obj.opacityVarMin;
        useOpacityVarMax = obj.useOpacityVarMax;
        opacityVarMax = obj.opacityVarMax;
        smoothData = obj.smoothData;
        samplesPerRay = obj.samplesPerRay;
        rendererType = obj.rendererType;
        gradientType = obj.gradientType;
        scaling = obj.scaling;
        skewFactor = obj.skewFactor;
        limitsMode = obj.limitsMode;
        sampling = obj.sampling;
        rendererSamples = obj.rendererSamples;
        lowGradientLightingReduction = obj.lowGradientLightingReduction;
        lowGradientLightingClampFlag = obj.lowGradientLightingClampFlag;
        lowGradientLightingClampValue = obj.lowGradientLightingClampValue;
        materialProperties = new double[4];
        for(i = 0; i < obj.materialProperties.length; ++i)
            materialProperties[i] = obj.materialProperties[i];


        SelectAll();
    }

    public int Offset()
    {
        return super.Offset() + super.GetNumAdditionalAttributes();
    }

    public int GetNumAdditionalAttributes()
    {
        return VolumeAttributes_numAdditionalAtts;
    }

    public boolean equals(VolumeAttributes obj)
    {
        int i;

        // Compare the freeformOpacity arrays.
        boolean freeformOpacity_equal = true;
        for(i = 0; i < 256 && freeformOpacity_equal; ++i)
            freeformOpacity_equal = (freeformOpacity[i] == obj.freeformOpacity[i]);

        // Compare the materialProperties arrays.
        boolean materialProperties_equal = true;
        for(i = 0; i < 4 && materialProperties_equal; ++i)
            materialProperties_equal = (materialProperties[i] == obj.materialProperties[i]);

        // Create the return value
        return ((OSPRayEnabledFlag == obj.OSPRayEnabledFlag) &&
                (OSPRayRenderType == obj.OSPRayRenderType) &&
                (OSPRayShadowsEnabledFlag == obj.OSPRayShadowsEnabledFlag) &&
                (OSPRayUseGridAcceleratorFlag == obj.OSPRayUseGridAcceleratorFlag) &&
                (OSPRayPreIntegrationFlag == obj.OSPRayPreIntegrationFlag) &&
                (OSPRaySingleShadeFlag == obj.OSPRaySingleShadeFlag) &&
                (OSPRayOneSidedLightingFlag == obj.OSPRayOneSidedLightingFlag) &&
                (OSPRayAOTransparencyEnabledFlag == obj.OSPRayAOTransparencyEnabledFlag) &&
                (OSPRaySPP == obj.OSPRaySPP) &&
                (OSPRayAOSamples == obj.OSPRayAOSamples) &&
                (OSPRayAODistance == obj.OSPRayAODistance) &&
                (OSPRayMinContribution == obj.OSPRayMinContribution) &&
                (OSPRayMaxContribution == obj.OSPRayMaxContribution) &&
                (legendFlag == obj.legendFlag) &&
                (lightingFlag == obj.lightingFlag) &&
                (colorControlPoints.equals(obj.colorControlPoints)) &&
                (opacityAttenuation == obj.opacityAttenuation) &&
                (opacityMode == obj.opacityMode) &&
                (opacityControlPoints.equals(obj.opacityControlPoints)) &&
                (resampleType == obj.resampleType) &&
                (resampleTarget == obj.resampleTarget) &&
                (resampleCentering == obj.resampleCentering) &&
                (opacityVariable.equals(obj.opacityVariable)) &&
                freeformOpacity_equal &&
                (useColorVarMin == obj.useColorVarMin) &&
                (colorVarMin == obj.colorVarMin) &&
                (useColorVarMax == obj.useColorVarMax) &&
                (colorVarMax == obj.colorVarMax) &&
                (useOpacityVarMin == obj.useOpacityVarMin) &&
                (opacityVarMin == obj.opacityVarMin) &&
                (useOpacityVarMax == obj.useOpacityVarMax) &&
                (opacityVarMax == obj.opacityVarMax) &&
                (smoothData == obj.smoothData) &&
                (samplesPerRay == obj.samplesPerRay) &&
                (rendererType == obj.rendererType) &&
                (gradientType == obj.gradientType) &&
                (scaling == obj.scaling) &&
                (skewFactor == obj.skewFactor) &&
                (limitsMode == obj.limitsMode) &&
                (sampling == obj.sampling) &&
                (rendererSamples == obj.rendererSamples) &&
                (lowGradientLightingReduction == obj.lowGradientLightingReduction) &&
                (lowGradientLightingClampFlag == obj.lowGradientLightingClampFlag) &&
                (lowGradientLightingClampValue == obj.lowGradientLightingClampValue) &&
                materialProperties_equal);
    }

    public String GetName() { return "Volume"; }
    public String GetVersion() { return "1.1"; }

    // Property setting methods
    public void SetOSPRayEnabledFlag(boolean OSPRayEnabledFlag_)
    {
        OSPRayEnabledFlag = OSPRayEnabledFlag_;
        Select(0);
    }

    public void SetOSPRayRenderType(int OSPRayRenderType_)
    {
        OSPRayRenderType = OSPRayRenderType_;
        Select(1);
    }

    public void SetOSPRayShadowsEnabledFlag(boolean OSPRayShadowsEnabledFlag_)
    {
        OSPRayShadowsEnabledFlag = OSPRayShadowsEnabledFlag_;
        Select(2);
    }

    public void SetOSPRayUseGridAcceleratorFlag(boolean OSPRayUseGridAcceleratorFlag_)
    {
        OSPRayUseGridAcceleratorFlag = OSPRayUseGridAcceleratorFlag_;
        Select(3);
    }

    public void SetOSPRayPreIntegrationFlag(boolean OSPRayPreIntegrationFlag_)
    {
        OSPRayPreIntegrationFlag = OSPRayPreIntegrationFlag_;
        Select(4);
    }

    public void SetOSPRaySingleShadeFlag(boolean OSPRaySingleShadeFlag_)
    {
        OSPRaySingleShadeFlag = OSPRaySingleShadeFlag_;
        Select(5);
    }

    public void SetOSPRayOneSidedLightingFlag(boolean OSPRayOneSidedLightingFlag_)
    {
        OSPRayOneSidedLightingFlag = OSPRayOneSidedLightingFlag_;
        Select(6);
    }

    public void SetOSPRayAOTransparencyEnabledFlag(boolean OSPRayAOTransparencyEnabledFlag_)
    {
        OSPRayAOTransparencyEnabledFlag = OSPRayAOTransparencyEnabledFlag_;
        Select(7);
    }

    public void SetOSPRaySPP(int OSPRaySPP_)
    {
        OSPRaySPP = OSPRaySPP_;
        Select(8);
    }

    public void SetOSPRayAOSamples(int OSPRayAOSamples_)
    {
        OSPRayAOSamples = OSPRayAOSamples_;
        Select(9);
    }

    public void SetOSPRayAODistance(double OSPRayAODistance_)
    {
        OSPRayAODistance = OSPRayAODistance_;
        Select(10);
    }

    public void SetOSPRayMinContribution(double OSPRayMinContribution_)
    {
        OSPRayMinContribution = OSPRayMinContribution_;
        Select(11);
    }

    public void SetOSPRayMaxContribution(double OSPRayMaxContribution_)
    {
        OSPRayMaxContribution = OSPRayMaxContribution_;
        Select(12);
    }

    public void SetLegendFlag(boolean legendFlag_)
    {
        legendFlag = legendFlag_;
        Select(13);
    }

    public void SetLightingFlag(boolean lightingFlag_)
    {
        lightingFlag = lightingFlag_;
        Select(14);
    }

    public void SetColorControlPoints(ColorControlPointList colorControlPoints_)
    {
        colorControlPoints = colorControlPoints_;
        Select(15);
    }

    public void SetOpacityAttenuation(float opacityAttenuation_)
    {
        opacityAttenuation = opacityAttenuation_;
        Select(16);
    }

    public void SetOpacityMode(int opacityMode_)
    {
        opacityMode = opacityMode_;
        Select(17);
    }

    public void SetOpacityControlPoints(GaussianControlPointList opacityControlPoints_)
    {
        opacityControlPoints = opacityControlPoints_;
        Select(18);
    }

    public void SetResampleType(int resampleType_)
    {
        resampleType = resampleType_;
        Select(19);
    }

    public void SetResampleTarget(int resampleTarget_)
    {
        resampleTarget = resampleTarget_;
        Select(20);
    }

    public void SetResampleCentering(int resampleCentering_)
    {
        resampleCentering = resampleCentering_;
        Select(21);
    }

    public void SetOpacityVariable(String opacityVariable_)
    {
        opacityVariable = opacityVariable_;
        Select(22);
    }

    public void SetFreeformOpacity(byte[] freeformOpacity_)
    {
        for(int i = 0; i < 256; ++i)
             freeformOpacity[i] = freeformOpacity_[i];
        Select(23);
    }

    public void SetUseColorVarMin(boolean useColorVarMin_)
    {
        useColorVarMin = useColorVarMin_;
        Select(24);
    }

    public void SetColorVarMin(float colorVarMin_)
    {
        colorVarMin = colorVarMin_;
        Select(25);
    }

    public void SetUseColorVarMax(boolean useColorVarMax_)
    {
        useColorVarMax = useColorVarMax_;
        Select(26);
    }

    public void SetColorVarMax(float colorVarMax_)
    {
        colorVarMax = colorVarMax_;
        Select(27);
    }

    public void SetUseOpacityVarMin(boolean useOpacityVarMin_)
    {
        useOpacityVarMin = useOpacityVarMin_;
        Select(28);
    }

    public void SetOpacityVarMin(float opacityVarMin_)
    {
        opacityVarMin = opacityVarMin_;
        Select(29);
    }

    public void SetUseOpacityVarMax(boolean useOpacityVarMax_)
    {
        useOpacityVarMax = useOpacityVarMax_;
        Select(30);
    }

    public void SetOpacityVarMax(float opacityVarMax_)
    {
        opacityVarMax = opacityVarMax_;
        Select(31);
    }

    public void SetSmoothData(boolean smoothData_)
    {
        smoothData = smoothData_;
        Select(32);
    }

    public void SetSamplesPerRay(int samplesPerRay_)
    {
        samplesPerRay = samplesPerRay_;
        Select(33);
    }

    public void SetRendererType(int rendererType_)
    {
        rendererType = rendererType_;
        Select(34);
    }

    public void SetGradientType(int gradientType_)
    {
        gradientType = gradientType_;
        Select(35);
    }

    public void SetScaling(int scaling_)
    {
        scaling = scaling_;
        Select(36);
    }

    public void SetSkewFactor(double skewFactor_)
    {
        skewFactor = skewFactor_;
        Select(37);
    }

    public void SetLimitsMode(int limitsMode_)
    {
        limitsMode = limitsMode_;
        Select(38);
    }

    public void SetSampling(int sampling_)
    {
        sampling = sampling_;
        Select(39);
    }

    public void SetRendererSamples(float rendererSamples_)
    {
        rendererSamples = rendererSamples_;
        Select(40);
    }

    public void SetLowGradientLightingReduction(int lowGradientLightingReduction_)
    {
        lowGradientLightingReduction = lowGradientLightingReduction_;
        Select(41);
    }

    public void SetLowGradientLightingClampFlag(boolean lowGradientLightingClampFlag_)
    {
        lowGradientLightingClampFlag = lowGradientLightingClampFlag_;
        Select(42);
    }

    public void SetLowGradientLightingClampValue(double lowGradientLightingClampValue_)
    {
        lowGradientLightingClampValue = lowGradientLightingClampValue_;
        Select(43);
    }

    public void SetMaterialProperties(double[] materialProperties_)
    {
        materialProperties[0] = materialProperties_[0];
        materialProperties[1] = materialProperties_[1];
        materialProperties[2] = materialProperties_[2];
        materialProperties[3] = materialProperties_[3];
        Select(44);
    }

    public void SetMaterialProperties(double e0, double e1, double e2, double e3)
    {
        materialProperties[0] = e0;
        materialProperties[1] = e1;
        materialProperties[2] = e2;
        materialProperties[3] = e3;
        Select(44);
    }

    // Property getting methods
    public boolean                  GetOSPRayEnabledFlag() { return OSPRayEnabledFlag; }
    public int                      GetOSPRayRenderType() { return OSPRayRenderType; }
    public boolean                  GetOSPRayShadowsEnabledFlag() { return OSPRayShadowsEnabledFlag; }
    public boolean                  GetOSPRayUseGridAcceleratorFlag() { return OSPRayUseGridAcceleratorFlag; }
    public boolean                  GetOSPRayPreIntegrationFlag() { return OSPRayPreIntegrationFlag; }
    public boolean                  GetOSPRaySingleShadeFlag() { return OSPRaySingleShadeFlag; }
    public boolean                  GetOSPRayOneSidedLightingFlag() { return OSPRayOneSidedLightingFlag; }
    public boolean                  GetOSPRayAOTransparencyEnabledFlag() { return OSPRayAOTransparencyEnabledFlag; }
    public int                      GetOSPRaySPP() { return OSPRaySPP; }
    public int                      GetOSPRayAOSamples() { return OSPRayAOSamples; }
    public double                   GetOSPRayAODistance() { return OSPRayAODistance; }
    public double                   GetOSPRayMinContribution() { return OSPRayMinContribution; }
    public double                   GetOSPRayMaxContribution() { return OSPRayMaxContribution; }
    public boolean                  GetLegendFlag() { return legendFlag; }
    public boolean                  GetLightingFlag() { return lightingFlag; }
    public ColorControlPointList    GetColorControlPoints() { return colorControlPoints; }
    public float                    GetOpacityAttenuation() { return opacityAttenuation; }
    public int                      GetOpacityMode() { return opacityMode; }
    public GaussianControlPointList GetOpacityControlPoints() { return opacityControlPoints; }
    public int                      GetResampleType() { return resampleType; }
    public int                      GetResampleTarget() { return resampleTarget; }
    public int                      GetResampleCentering() { return resampleCentering; }
    public String                   GetOpacityVariable() { return opacityVariable; }
    public byte[]                   GetFreeformOpacity() { return freeformOpacity; }
    public boolean                  GetUseColorVarMin() { return useColorVarMin; }
    public float                    GetColorVarMin() { return colorVarMin; }
    public boolean                  GetUseColorVarMax() { return useColorVarMax; }
    public float                    GetColorVarMax() { return colorVarMax; }
    public boolean                  GetUseOpacityVarMin() { return useOpacityVarMin; }
    public float                    GetOpacityVarMin() { return opacityVarMin; }
    public boolean                  GetUseOpacityVarMax() { return useOpacityVarMax; }
    public float                    GetOpacityVarMax() { return opacityVarMax; }
    public boolean                  GetSmoothData() { return smoothData; }
    public int                      GetSamplesPerRay() { return samplesPerRay; }
    public int                      GetRendererType() { return rendererType; }
    public int                      GetGradientType() { return gradientType; }
    public int                      GetScaling() { return scaling; }
    public double                   GetSkewFactor() { return skewFactor; }
    public int                      GetLimitsMode() { return limitsMode; }
    public int                      GetSampling() { return sampling; }
    public float                    GetRendererSamples() { return rendererSamples; }
    public int                      GetLowGradientLightingReduction() { return lowGradientLightingReduction; }
    public boolean                  GetLowGradientLightingClampFlag() { return lowGradientLightingClampFlag; }
    public double                   GetLowGradientLightingClampValue() { return lowGradientLightingClampValue; }
    public double[]                 GetMaterialProperties() { return materialProperties; }

    // Write and read methods.
    public void WriteAtts(CommunicationBuffer buf)
    {
        if(WriteSelect(0, buf))
            buf.WriteBool(OSPRayEnabledFlag);
        if(WriteSelect(1, buf))
            buf.WriteInt(OSPRayRenderType);
        if(WriteSelect(2, buf))
            buf.WriteBool(OSPRayShadowsEnabledFlag);
        if(WriteSelect(3, buf))
            buf.WriteBool(OSPRayUseGridAcceleratorFlag);
        if(WriteSelect(4, buf))
            buf.WriteBool(OSPRayPreIntegrationFlag);
        if(WriteSelect(5, buf))
            buf.WriteBool(OSPRaySingleShadeFlag);
        if(WriteSelect(6, buf))
            buf.WriteBool(OSPRayOneSidedLightingFlag);
        if(WriteSelect(7, buf))
            buf.WriteBool(OSPRayAOTransparencyEnabledFlag);
        if(WriteSelect(8, buf))
            buf.WriteInt(OSPRaySPP);
        if(WriteSelect(9, buf))
            buf.WriteInt(OSPRayAOSamples);
        if(WriteSelect(10, buf))
            buf.WriteDouble(OSPRayAODistance);
        if(WriteSelect(11, buf))
            buf.WriteDouble(OSPRayMinContribution);
        if(WriteSelect(12, buf))
            buf.WriteDouble(OSPRayMaxContribution);
        if(WriteSelect(13, buf))
            buf.WriteBool(legendFlag);
        if(WriteSelect(14, buf))
            buf.WriteBool(lightingFlag);
        if(WriteSelect(15, buf))
            colorControlPoints.Write(buf);
        if(WriteSelect(16, buf))
            buf.WriteFloat(opacityAttenuation);
        if(WriteSelect(17, buf))
            buf.WriteInt(opacityMode);
        if(WriteSelect(18, buf))
            opacityControlPoints.Write(buf);
        if(WriteSelect(19, buf))
            buf.WriteInt(resampleType);
        if(WriteSelect(20, buf))
            buf.WriteInt(resampleTarget);
        if(WriteSelect(21, buf))
            buf.WriteInt(resampleCentering);
        if(WriteSelect(22, buf))
            buf.WriteString(opacityVariable);
        if(WriteSelect(23, buf))
            buf.WriteByteArray(freeformOpacity, true);
        if(WriteSelect(24, buf))
            buf.WriteBool(useColorVarMin);
        if(WriteSelect(25, buf))
            buf.WriteFloat(colorVarMin);
        if(WriteSelect(26, buf))
            buf.WriteBool(useColorVarMax);
        if(WriteSelect(27, buf))
            buf.WriteFloat(colorVarMax);
        if(WriteSelect(28, buf))
            buf.WriteBool(useOpacityVarMin);
        if(WriteSelect(29, buf))
            buf.WriteFloat(opacityVarMin);
        if(WriteSelect(30, buf))
            buf.WriteBool(useOpacityVarMax);
        if(WriteSelect(31, buf))
            buf.WriteFloat(opacityVarMax);
        if(WriteSelect(32, buf))
            buf.WriteBool(smoothData);
        if(WriteSelect(33, buf))
            buf.WriteInt(samplesPerRay);
        if(WriteSelect(34, buf))
            buf.WriteInt(rendererType);
        if(WriteSelect(35, buf))
            buf.WriteInt(gradientType);
        if(WriteSelect(36, buf))
            buf.WriteInt(scaling);
        if(WriteSelect(37, buf))
            buf.WriteDouble(skewFactor);
        if(WriteSelect(38, buf))
            buf.WriteInt(limitsMode);
        if(WriteSelect(39, buf))
            buf.WriteInt(sampling);
        if(WriteSelect(40, buf))
            buf.WriteFloat(rendererSamples);
        if(WriteSelect(41, buf))
            buf.WriteInt(lowGradientLightingReduction);
        if(WriteSelect(42, buf))
            buf.WriteBool(lowGradientLightingClampFlag);
        if(WriteSelect(43, buf))
            buf.WriteDouble(lowGradientLightingClampValue);
        if(WriteSelect(44, buf))
            buf.WriteDoubleArray(materialProperties);
    }

    public void ReadAtts(int index, CommunicationBuffer buf)
    {
        switch(index)
        {
        case 0:
            SetOSPRayEnabledFlag(buf.ReadBool());
            break;
        case 1:
            SetOSPRayRenderType(buf.ReadInt());
            break;
        case 2:
            SetOSPRayShadowsEnabledFlag(buf.ReadBool());
            break;
        case 3:
            SetOSPRayUseGridAcceleratorFlag(buf.ReadBool());
            break;
        case 4:
            SetOSPRayPreIntegrationFlag(buf.ReadBool());
            break;
        case 5:
            SetOSPRaySingleShadeFlag(buf.ReadBool());
            break;
        case 6:
            SetOSPRayOneSidedLightingFlag(buf.ReadBool());
            break;
        case 7:
            SetOSPRayAOTransparencyEnabledFlag(buf.ReadBool());
            break;
        case 8:
            SetOSPRaySPP(buf.ReadInt());
            break;
        case 9:
            SetOSPRayAOSamples(buf.ReadInt());
            break;
        case 10:
            SetOSPRayAODistance(buf.ReadDouble());
            break;
        case 11:
            SetOSPRayMinContribution(buf.ReadDouble());
            break;
        case 12:
            SetOSPRayMaxContribution(buf.ReadDouble());
            break;
        case 13:
            SetLegendFlag(buf.ReadBool());
            break;
        case 14:
            SetLightingFlag(buf.ReadBool());
            break;
        case 15:
            colorControlPoints.Read(buf);
            Select(15);
            break;
        case 16:
            SetOpacityAttenuation(buf.ReadFloat());
            break;
        case 17:
            SetOpacityMode(buf.ReadInt());
            break;
        case 18:
            opacityControlPoints.Read(buf);
            Select(18);
            break;
        case 19:
            SetResampleType(buf.ReadInt());
            break;
        case 20:
            SetResampleTarget(buf.ReadInt());
            break;
        case 21:
            SetResampleCentering(buf.ReadInt());
            break;
        case 22:
            SetOpacityVariable(buf.ReadString());
            break;
        case 23:
            SetFreeformOpacity(buf.ReadByteArray());
            break;
        case 24:
            SetUseColorVarMin(buf.ReadBool());
            break;
        case 25:
            SetColorVarMin(buf.ReadFloat());
            break;
        case 26:
            SetUseColorVarMax(buf.ReadBool());
            break;
        case 27:
            SetColorVarMax(buf.ReadFloat());
            break;
        case 28:
            SetUseOpacityVarMin(buf.ReadBool());
            break;
        case 29:
            SetOpacityVarMin(buf.ReadFloat());
            break;
        case 30:
            SetUseOpacityVarMax(buf.ReadBool());
            break;
        case 31:
            SetOpacityVarMax(buf.ReadFloat());
            break;
        case 32:
            SetSmoothData(buf.ReadBool());
            break;
        case 33:
            SetSamplesPerRay(buf.ReadInt());
            break;
        case 34:
            SetRendererType(buf.ReadInt());
            break;
        case 35:
            SetGradientType(buf.ReadInt());
            break;
        case 36:
            SetScaling(buf.ReadInt());
            break;
        case 37:
            SetSkewFactor(buf.ReadDouble());
            break;
        case 38:
            SetLimitsMode(buf.ReadInt());
            break;
        case 39:
            SetSampling(buf.ReadInt());
            break;
        case 40:
            SetRendererSamples(buf.ReadFloat());
            break;
        case 41:
            SetLowGradientLightingReduction(buf.ReadInt());
            break;
        case 42:
            SetLowGradientLightingClampFlag(buf.ReadBool());
            break;
        case 43:
            SetLowGradientLightingClampValue(buf.ReadDouble());
            break;
        case 44:
            SetMaterialProperties(buf.ReadDoubleArray());
            break;
        }
    }

    public String toString(String indent)
    {
        String str = new String();
        str = str + boolToString("OSPRayEnabledFlag", OSPRayEnabledFlag, indent) + "\n";
        str = str + indent + "OSPRayRenderType = ";
        if(OSPRayRenderType == OSPRAYRENDERTYPES_SCIVIS)
            str = str + "OSPRAYRENDERTYPES_SCIVIS";
        if(OSPRayRenderType == OSPRAYRENDERTYPES_PATHTRACER)
            str = str + "OSPRAYRENDERTYPES_PATHTRACER";
        str = str + "\n";
        str = str + boolToString("OSPRayShadowsEnabledFlag", OSPRayShadowsEnabledFlag, indent) + "\n";
        str = str + boolToString("OSPRayUseGridAcceleratorFlag", OSPRayUseGridAcceleratorFlag, indent) + "\n";
        str = str + boolToString("OSPRayPreIntegrationFlag", OSPRayPreIntegrationFlag, indent) + "\n";
        str = str + boolToString("OSPRaySingleShadeFlag", OSPRaySingleShadeFlag, indent) + "\n";
        str = str + boolToString("OSPRayOneSidedLightingFlag", OSPRayOneSidedLightingFlag, indent) + "\n";
        str = str + boolToString("OSPRayAOTransparencyEnabledFlag", OSPRayAOTransparencyEnabledFlag, indent) + "\n";
        str = str + intToString("OSPRaySPP", OSPRaySPP, indent) + "\n";
        str = str + intToString("OSPRayAOSamples", OSPRayAOSamples, indent) + "\n";
        str = str + doubleToString("OSPRayAODistance", OSPRayAODistance, indent) + "\n";
        str = str + doubleToString("OSPRayMinContribution", OSPRayMinContribution, indent) + "\n";
        str = str + doubleToString("OSPRayMaxContribution", OSPRayMaxContribution, indent) + "\n";
        str = str + boolToString("legendFlag", legendFlag, indent) + "\n";
        str = str + boolToString("lightingFlag", lightingFlag, indent) + "\n";
        str = str + indent + "colorControlPoints = {\n" + colorControlPoints.toString(indent + "    ") + indent + "}\n";
        str = str + floatToString("opacityAttenuation", opacityAttenuation, indent) + "\n";
        str = str + indent + "opacityMode = ";
        if(opacityMode == OPACITYMODES_FREEFORMMODE)
            str = str + "OPACITYMODES_FREEFORMMODE";
        if(opacityMode == OPACITYMODES_GAUSSIANMODE)
            str = str + "OPACITYMODES_GAUSSIANMODE";
        if(opacityMode == OPACITYMODES_COLORTABLEMODE)
            str = str + "OPACITYMODES_COLORTABLEMODE";
        str = str + "\n";
        str = str + indent + "opacityControlPoints = {\n" + opacityControlPoints.toString(indent + "    ") + indent + "}\n";
        str = str + indent + "resampleType = ";
        if(resampleType == RESAMPLETYPE_ONLYIFREQUIRED)
            str = str + "RESAMPLETYPE_ONLYIFREQUIRED";
        if(resampleType == RESAMPLETYPE_SINGLEDOMAIN)
            str = str + "RESAMPLETYPE_SINGLEDOMAIN";
        if(resampleType == RESAMPLETYPE_PARALLELREDISTRIBUTE)
            str = str + "RESAMPLETYPE_PARALLELREDISTRIBUTE";
        if(resampleType == RESAMPLETYPE_PARALLELPERRANK)
            str = str + "RESAMPLETYPE_PARALLELPERRANK";
        if(resampleType == RESAMPLETYPE_NORESAMPLING)
            str = str + "RESAMPLETYPE_NORESAMPLING";
        str = str + "\n";
        str = str + intToString("resampleTarget", resampleTarget, indent) + "\n";
        str = str + indent + "resampleCentering = ";
        if(resampleCentering == RESAMPLECENTERING_NATIVECENTERING)
            str = str + "RESAMPLECENTERING_NATIVECENTERING";
        if(resampleCentering == RESAMPLECENTERING_NODALCENTERING)
            str = str + "RESAMPLECENTERING_NODALCENTERING";
        if(resampleCentering == RESAMPLECENTERING_ZONALCENTERING)
            str = str + "RESAMPLECENTERING_ZONALCENTERING";
        str = str + "\n";
        str = str + stringToString("opacityVariable", opacityVariable, indent) + "\n";
        str = str + ucharArrayToString("freeformOpacity", freeformOpacity, indent) + "\n";
        str = str + boolToString("useColorVarMin", useColorVarMin, indent) + "\n";
        str = str + floatToString("colorVarMin", colorVarMin, indent) + "\n";
        str = str + boolToString("useColorVarMax", useColorVarMax, indent) + "\n";
        str = str + floatToString("colorVarMax", colorVarMax, indent) + "\n";
        str = str + boolToString("useOpacityVarMin", useOpacityVarMin, indent) + "\n";
        str = str + floatToString("opacityVarMin", opacityVarMin, indent) + "\n";
        str = str + boolToString("useOpacityVarMax", useOpacityVarMax, indent) + "\n";
        str = str + floatToString("opacityVarMax", opacityVarMax, indent) + "\n";
        str = str + boolToString("smoothData", smoothData, indent) + "\n";
        str = str + intToString("samplesPerRay", samplesPerRay, indent) + "\n";
        str = str + indent + "rendererType = ";
        if(rendererType == RENDERER_SERIAL)
            str = str + "RENDERER_SERIAL";
        if(rendererType == RENDERER_PARALLEL)
            str = str + "RENDERER_PARALLEL";
        if(rendererType == RENDERER_COMPOSITE)
            str = str + "RENDERER_COMPOSITE";
        if(rendererType == RENDERER_INTEGRATION)
            str = str + "RENDERER_INTEGRATION";
        if(rendererType == RENDERER_SLIVR)
            str = str + "RENDERER_SLIVR";
        str = str + "\n";
        str = str + indent + "gradientType = ";
        if(gradientType == GRADIENTTYPE_CENTEREDDIFFERENCES)
            str = str + "GRADIENTTYPE_CENTEREDDIFFERENCES";
        if(gradientType == GRADIENTTYPE_SOBELOPERATOR)
            str = str + "GRADIENTTYPE_SOBELOPERATOR";
        str = str + "\n";
        str = str + indent + "scaling = ";
        if(scaling == SCALING_LINEAR)
            str = str + "SCALING_LINEAR";
        if(scaling == SCALING_LOG)
            str = str + "SCALING_LOG";
        if(scaling == SCALING_SKEW)
            str = str + "SCALING_SKEW";
        str = str + "\n";
        str = str + doubleToString("skewFactor", skewFactor, indent) + "\n";
        str = str + indent + "limitsMode = ";
        if(limitsMode == LIMITSMODE_ORIGINALDATA)
            str = str + "LIMITSMODE_ORIGINALDATA";
        if(limitsMode == LIMITSMODE_CURRENTPLOT)
            str = str + "LIMITSMODE_CURRENTPLOT";
        str = str + "\n";
        str = str + indent + "sampling = ";
        if(sampling == SAMPLINGTYPE_KERNELBASED)
            str = str + "SAMPLINGTYPE_KERNELBASED";
        if(sampling == SAMPLINGTYPE_RASTERIZATION)
            str = str + "SAMPLINGTYPE_RASTERIZATION";
        if(sampling == SAMPLINGTYPE_TRILINEAR)
            str = str + "SAMPLINGTYPE_TRILINEAR";
        str = str + "\n";
        str = str + floatToString("rendererSamples", rendererSamples, indent) + "\n";
        str = str + indent + "lowGradientLightingReduction = ";
        if(lowGradientLightingReduction == LOWGRADIENTLIGHTINGREDUCTION_OFF)
            str = str + "LOWGRADIENTLIGHTINGREDUCTION_OFF";
        if(lowGradientLightingReduction == LOWGRADIENTLIGHTINGREDUCTION_LOWEST)
            str = str + "LOWGRADIENTLIGHTINGREDUCTION_LOWEST";
        if(lowGradientLightingReduction == LOWGRADIENTLIGHTINGREDUCTION_LOWER)
            str = str + "LOWGRADIENTLIGHTINGREDUCTION_LOWER";
        if(lowGradientLightingReduction == LOWGRADIENTLIGHTINGREDUCTION_LOW)
            str = str + "LOWGRADIENTLIGHTINGREDUCTION_LOW";
        if(lowGradientLightingReduction == LOWGRADIENTLIGHTINGREDUCTION_MEDIUM)
            str = str + "LOWGRADIENTLIGHTINGREDUCTION_MEDIUM";
        if(lowGradientLightingReduction == LOWGRADIENTLIGHTINGREDUCTION_HIGH)
            str = str + "LOWGRADIENTLIGHTINGREDUCTION_HIGH";
        if(lowGradientLightingReduction == LOWGRADIENTLIGHTINGREDUCTION_HIGHER)
            str = str + "LOWGRADIENTLIGHTINGREDUCTION_HIGHER";
        if(lowGradientLightingReduction == LOWGRADIENTLIGHTINGREDUCTION_HIGHEST)
            str = str + "LOWGRADIENTLIGHTINGREDUCTION_HIGHEST";
        str = str + "\n";
        str = str + boolToString("lowGradientLightingClampFlag", lowGradientLightingClampFlag, indent) + "\n";
        str = str + doubleToString("lowGradientLightingClampValue", lowGradientLightingClampValue, indent) + "\n";
        str = str + doubleArrayToString("materialProperties", materialProperties, indent) + "\n";
        return str;
    }


    // Attributes
    private boolean                  OSPRayEnabledFlag;
    private int                      OSPRayRenderType;
    private boolean                  OSPRayShadowsEnabledFlag;
    private boolean                  OSPRayUseGridAcceleratorFlag;
    private boolean                  OSPRayPreIntegrationFlag;
    private boolean                  OSPRaySingleShadeFlag;
    private boolean                  OSPRayOneSidedLightingFlag;
    private boolean                  OSPRayAOTransparencyEnabledFlag;
    private int                      OSPRaySPP;
    private int                      OSPRayAOSamples;
    private double                   OSPRayAODistance;
    private double                   OSPRayMinContribution;
    private double                   OSPRayMaxContribution;
    private boolean                  legendFlag;
    private boolean                  lightingFlag;
    private ColorControlPointList    colorControlPoints;
    private float                    opacityAttenuation;
    private int                      opacityMode;
    private GaussianControlPointList opacityControlPoints;
    private int                      resampleType;
    private int                      resampleTarget;
    private int                      resampleCentering;
    private String                   opacityVariable;
    private byte[]                   freeformOpacity;
    private boolean                  useColorVarMin;
    private float                    colorVarMin;
    private boolean                  useColorVarMax;
    private float                    colorVarMax;
    private boolean                  useOpacityVarMin;
    private float                    opacityVarMin;
    private boolean                  useOpacityVarMax;
    private float                    opacityVarMax;
    private boolean                  smoothData;
    private int                      samplesPerRay;
    private int                      rendererType;
    private int                      gradientType;
    private int                      scaling;
    private double                   skewFactor;
    private int                      limitsMode;
    private int                      sampling;
    private float                    rendererSamples;
    private int                      lowGradientLightingReduction;
    private boolean                  lowGradientLightingClampFlag;
    private double                   lowGradientLightingClampValue;
    private double[]                 materialProperties;
}

